<h1>Known Restaurants</h1>

<table cellspacing="10">
  <tr>
    <th>Name</th>
    <th>Address (line 1)</th>
    <th>Address (line 2)</th>
    <th>City</th>
    <th>State</th>
    <th>Zip</th>
    <th>Phone</th>
    <% if current_user && current_user.isadmin %>
    <th></th>
    <th></th>
    <% end %>
  </tr>

<% @restaurants.each do |restaurant| %>
  <tr>
    <td><%= restaurant.name %></td>
    <td><%= restaurant.addr1 %></td>
    <td><%= restaurant.addr2 %></td>
    <td><%= restaurant.city %></td>
    <td><%= restaurant.state %></td>
    <td><%= restaurant.zip %></td>
    <td><%= restaurant.phone %></td>
    <% if current_user && current_user.isadmin %>
    <td><%= link_to 'Edit', edit_restaurant_path(restaurant) %></td>
    <td><%= link_to 'Destroy', restaurant, :confirm => 'Are you sure?', :method => :delete %></td>
    <% end %>
  </tr>
<% end %>
</table>

<br />

<% if current_user && current_user.isadmin %>
<%= link_to 'New Restaurant', new_restaurant_path %>
<% end %>
<%= link_to 'Back', :back %>

